import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)
//导入持久化依赖包
import VuexPersistence from 'vuex-persist'
//实例化持久化插件对象
const vuexLocal = new VuexPersistence({
  storage: window.sessionStorage,//存储介质,
  key: "gq_vuex",//存储到本地存储
})
export default new Vuex.Store({
  state: {
    gq_token: "",
    users: {}
  },
  mutations: {
    guoqin(state, obj) {
     
      state.gq_token = obj.token;
      state.users = obj;
    }
  },
  actions: {

  },
  plugins: [vuexLocal.plugin]
})
